package com.example.asus.myapplication;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.ImageView;

import com.example.myprojectoffeixue.LoginActivity;
import com.example.myprojectoffeixue.MyGateWayActivity;
import com.example.myprojectoffeixue.R;
import com.example.myprojectoffeixue.ReginActivity;
import com.example.myprojectoffeixue.WangJiMMActivity;
import com.robotium.solo.Solo;
/**
 * Created by ASUS on 2016/9/19.
 */

public class LoginTest extends ActivityInstrumentationTestCase2 {

    private Solo solo;

    public LoginTest() {
        super(LoginActivity.class);

    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        solo = new Solo(getInstrumentation(), getActivity());
    }

    public void testwangji() throws  Exception{
        solo.clickOnText("忘记密码");
        solo.sleep(2000);
        solo.assertCurrentActivity("11", WangJiMMActivity.class,true);
        solo.goBack();
    }

    public void testregin() throws Exception {
        solo.clickOnText("没有账户？立即注册吧");
        LoginActivity lo= (LoginActivity) solo.getCurrentActivity();
        solo.sleep(2000);
        solo.assertCurrentActivity("11", ReginActivity.class,true);
        solo.goBack();

    }

  public void testLogin1() throws Exception {
        solo.enterText(solo.getEditText(0),"15639767013");
        solo.enterText( solo.getEditText(1),"yuyang123456");
        solo.clickOnText("登录");
        LoginActivity lo= (LoginActivity) solo.getCurrentActivity();
        solo.sleep(2000);
        solo.assertCurrentActivity("11",MyGateWayActivity.class,true);


    }

    public void testLogin2() throws Exception {
        solo.enterText(solo.getEditText(0),"15639767013");
        solo.enterText( solo.getEditText(1),"yuyang");
        solo.clickOnText("登录");
        solo.sleep(2000);
        solo.assertCurrentActivity("11",LoginActivity.class,true);
    }








    public void testrem() throws Exception {
        solo.clickOnImage(1);
    }
























}
